Using Obsidian URI
Obsidian supports a custom URI protocol obsidian:// which can be used to trigger various actions within the app. This is commonly used on MacOS and mobile apps for automation and cross-app workflows.
If you have Obsidian installed, this link will open the app on your device: Click here
Installing Obsidian URI
To make sure your operating system redirect obsidian:// URIs to the Obsidian app, there may be additional steps you need to perform.
- On Windows, running the app once should be sufficient. This will register for the
obsidian://custom protocol handler in the Windows registry. - On MacOS, running the app once should be sufficient, however, your app must be installer version 0.8.12 or later.
- On Linux, there's a much more involved process:
- First, ensure you create a
obsidian.desktopfile. See here for details - Ensure that your desktop file specifies the
Execfield asExec=executable %u. The%uis used to pass theobsidian://URIs to the app. - If you're using the AppImage installer, you may have to unpack it using
Obsidian-x.y.z.AppImage --appimage-extract. Then make sure theExecdirective points to the unpacked executable.
- First, ensure you create a
Using Obsidian URIs
Obsidian URIs are typically in this format:
obsidian://action?param1=value¶m2=value
- The
actionis usually the action that you would like to perform.
Encoding
==Important==
Ensure that your values are properly URI encoded. For example, forward slash characters / must be encoded as %2F and space characters must be encoded as %20.
This is especially important because an improperly encoded "reserved" character may break the interpretation of the URI. See here for details
Available actions
Action open
Description: Opens an Obsidian vault, and possibly open a file within that vault.
Possible parameters:
vaultcan be either the vault name, or the vault ID.- The vault name is simply the name of the vault folder.
- The vault ID is the random 16-character code assigned to the vault. This ID is unique per folder on your computer. Example:
ef6ca3e3b524d22f. There isn't an easy way to find this ID yet, one will be offered at a later date in the vault switcher. Currently it can be found in%appdata%/obsidian/obsidian.jsonfor Windows. For MacOS, replace%appdata%with~/Library/Application Support/. For Linux, replace%appdata%with~/.config/.
filecan be either a file name, or a path from the vault root to the specified file.- To resolve the target file, Obsidian uses the same link resolution system as a regular
[[wikilink]]within the vault. - If the file extension is
md, the extension can be omitted.
- To resolve the target file, Obsidian uses the same link resolution system as a regular
pathan absolute file system path to a file.- Using this parameter will override both
vaultandfile. - This will cause the app to search for the most specific vault which contains the specified file path.
- Then the rest of the path replaces the
fileparameter.
- Using this parameter will override both
Examples:
obsidian://open?vault=my%20vaultThis opens the vaultmy vault. If the vault is already open, focus on the window.obsidian://open?vault=ef6ca3e3b524d22fThis opens the vault identified by the IDef6ca3e3b524d22f.obsidian://open?vault=my%20vault&file=my%20noteThis opens the notemy notein the vaultmy vault, assumingmy noteexists and the file ismy note.md.obsidian://open?vault=my%20vault&file=my%20note.mdThis also opens the notemy notein the vaultmy vault.obsidian://open?vault=my%20vault&file=path%2Fto%2Fmy%20noteThis opens the note located atpath/to/my notein the vaultmy vault.obsidian://open?path=%2Fhome%2Fuser%2Fmy%20vault%2Fpath%2Fto%2Fmy%20noteThis will look for any vault that contains the path/home/user/my vault/path/to/my note. Then, the rest of the path is passed to thefileparameter. For example, if a vault exists at/home/user/my vault, then this would be equivalent tofileparameter set topath/to/my note.obsidian://open?path=D%3A%5CDocuments%5CMy%20vault%5CMy%20noteThis will look for any vault that contains the pathD:\Documents\My vault\My note. Then, the rest of the path is passed to thefileparameter. For example, if a vault exists atD:\Documents\My vault, then this would be equivalent tofileparameter set toMy note.
Action search
Description: Opens the search pane for a vault, and optionally perform a search query.
Possible parameters:
vaultcan be either the vault name, or the vault ID. Same as actionopen.query(optional) The search query to perform.
Examples:
obsidian://search?vault=my%20vaultThis opens the vaultmy vault, and opens the search pane.obsidian://search?vault=my%20vault&query=MOCThis opens the vaultmy vault, opens the search pane, and performs a search forMOC.
Action new
Description: Creates a new note in the vault, optionally with some content.
Possible parameters:
vaultcan be either the vault name, or the vault ID. Same as actionopen.namethe file name to be created. If this is specified, the file location will be chosen based on your "Default location for new notes" preferences.filea vault absolute path, including the name. Will overridenameif specified.patha globally absolute path. Works similar to thepathoption in theopenaction, which will override bothvaultandfile.content(optional) the contents of the note.silent(optional) set this if you don't want to open the new note.
Examples:
obsidian://new?vault=my%20vault&name=my%20noteThis opens the vaultmy vault, and creates a new note calledmy note.obsidian://new?vault=my%20vault&path=path%2Fto%2Fmy%20noteThis opens the vaultmy vault, and creates a new note atpath/to/my note.
Action hook-get-address
Description: Endpoint for use with Hook. Copies a markdown link of the current focused note to the clipboard, as an obsidian://open URL. Use: obsidian://hook-get-address
Possible parameters:
vault(optional) can be either the vault name, or the vault ID. If not provided, the current or last focused vault will be used.
Shorthand formats
In addition to the formats above, there are two more "shorthand" formats available to open vaults and files:
obsidian://vault/my vault/my noteis equivalent toobsidian://open?vault=my%20vault&file=my%20noteobsidian:///absolute/path/to/my noteis equivalent toobsidian://open?path=%2Fabsolute%2Fpath%2Fto%2Fmy%20note